package cn.ytnet.shangyun.service.basic.entity;

import org.springframework.stereotype.Component;

import javax.persistence.*;
import java.io.Serializable;

/**
 * Created by cyongk on 2015/12/8.
 * ClassName:ProvinceEntity
 * ChineseName:行政区域省（直辖市）类
 */
@Component("provinceEntity")
@Entity
@Table(name = "t_province", schema = "crebas", catalog = "")
public class ProvinceEntity implements Serializable{
    private static final long serialVersionUID = 1002365444056381429L;
    private String pkTProvinceId;
    private String provinceName;
    private String provincetPhoneticcode;

    @Id
    @Column(name = "pk_t_province_id", nullable = false, length = 5)
    public String getPkTProvinceId() {
        return pkTProvinceId;
    }

    public void setPkTProvinceId(String pkTProvinceId) {
        this.pkTProvinceId = pkTProvinceId;
    }

    @Basic
    @Column(name = "province_name", nullable = false, length = 20)
    public String getProvinceName() {
        return provinceName;
    }

    public void setProvinceName(String provinceName) {
        this.provinceName = provinceName;
    }

    @Basic
    @Column(name = "provincet_phoneticcode", nullable = false, length = 100)
    public String getProvincetPhoneticcode() {
        return provincetPhoneticcode;
    }

    public void setProvincetPhoneticcode(String provincetPhoneticcode) {
        this.provincetPhoneticcode = provincetPhoneticcode;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        ProvinceEntity that = (ProvinceEntity) o;

        if (pkTProvinceId != null ? !pkTProvinceId.equals(that.pkTProvinceId) : that.pkTProvinceId != null)
            return false;
        if (provinceName != null ? !provinceName.equals(that.provinceName) : that.provinceName != null) return false;
        return provincetPhoneticcode != null ? provincetPhoneticcode.equals(that.provincetPhoneticcode) : that.provincetPhoneticcode == null;

    }

    @Override
    public int hashCode() {
        int result = pkTProvinceId != null ? pkTProvinceId.hashCode() : 0;
        result = 31 * result + (provinceName != null ? provinceName.hashCode() : 0);
        result = 31 * result + (provincetPhoneticcode != null ? provincetPhoneticcode.hashCode() : 0);
        return result;
    }
}
